<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>共用的头和尾</title>
</head>
<body>

<div class="header" th:fragment="header">
    <p>this is header</p>
</div>

<div class="footer" th:fragment="footer">
    <p>this is footer</p>
</div>

</body>
</html>